package org.xshop.service.impl;

import java.util.Map;

import org.springframework.cache.annotation.CacheConfig;
import org.xshop.mapper.TActivityMapper;
import org.xshop.model.TActivity;
import org.xshop.service.ITActivityService;

import com.weibo.api.motan.config.springsupport.annotation.MotanService;

import top.ibase4j.core.base.BaseServiceImpl;
import top.ibase4j.core.support.Pagination;

/**
 * <p>
 * 活动  服务实现类
 * </p>
 *
 * @author ShenHuaJie
 * @since 2018-04-08
 */
@MotanService(interfaceClass = ITActivityService.class)
@CacheConfig(cacheNames = "TActivity")
public class ActivityService extends BaseServiceImpl<TActivity, TActivityMapper> implements ITActivityService {

	@Override
	public Object queryAll(Map<String, Object> param) {
		int pageNum = param.get("pageNum") == null ? 1 : Integer.parseInt(param.get("pageNum").toString());
		int pageSize = 10;
		param.put("offset", (pageNum - 1) * pageSize);
		param.put("limit", pageSize);
		param.put("enable", "1");
		Pagination<TActivity> page = query(param);
		return page;
	}

}